﻿using System;
using System.Threading.Tasks;

using Windows.UI.Xaml;

using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;

using Uhimania.Libraries.Test;

using Uhimania.Libraries.Windows.Interactivity;

namespace Windows.InteractivityTest
{
    [TestClass]
    public class InteractionTest
    {
        #region Behaviors

        #region 正常エース
        [TestMethod]
        public async Task Behaviors_正常ケース()
        {
            await UiTestHelper.ExecuteOnUiThread(() =>
            {
                var mock = new Mock();
                var behavior = new BehaviorMock();
                Interaction.GetBehaviors(mock).Add(behavior);
                behavior.AssociatedObject.Is(mock);
            });
        }
        #endregion

        #endregion

        #region Triggers

        #region 正常エース
        [TestMethod]
        public async Task Triggers_正常ケース()
        {
            await UiTestHelper.ExecuteOnUiThread(() =>
            {
                var mock = new Mock();
                var trigger = new TriggerMock();
                Interaction.GetTriggers(mock).Add(trigger);
                trigger.AssociatedObject.Is(mock);
            });
        }
        #endregion

        #endregion

        #region Mock

        private class Mock : DependencyObject
        {
        }

        private class BehaviorMock : Behavior<Mock>
        {
        }

        private class TriggerMock : TriggerBase<Mock>
        {
        }

        #endregion
    }
}
